import { Singleton } from "db://assets/Scripts/Base/Singleton";
import { ChineseSentence } from "db://assets/Scripts/Enums/Sentences/ChnEnum";
import { LanguageTypeEnum } from "db://assets/Scripts/Enums/Sentences/LanguageTypeEnum";

export class CheckOutEnum extends Singleton {
  enumType: number = LanguageTypeEnum.CHINESE;

  // 重写getInstance方法,确保返回类型为 CheckOutEnum
  public static getInstance(): CheckOutEnum {
    if (!this.instance) {
      this.instance = new this();
    }
    return this.instance as CheckOutEnum;
  }

  /**
   * 根据提供的数字类型返回对应的枚举类型
   * @param enumType - 用于指定返回哪个枚举类型的数字
   * @returns 返回对应的枚举类型
   */
  getEnumByType(): any {
    switch (this.enumType) {
      case LanguageTypeEnum.CHINESE:
        return ChineseSentence;
      default:
        return ChineseSentence;
    }
  }
}
